<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
  <head>
    <title>Core Java Bug List</title> 
    <link type='text/css' rel='stylesheet' href='../styles.css'/> 
    <meta content='text/html; charset=UTF-8' http-equiv='content-type'/> 
    <script src='../checksubmit.js' type='text/javascript'></script> 
  </head> 
  <body onload='load(document.forms["feedback"])'>

    <h1>Welcome to the Core Java Bug List</h1> 
    <ul>
      <li><a href='#CJ10V1'>10th Edition Volume 1 (Java SE 8)</a> </li> 
      <li><a href='#CJ10V2'>10th Edition Volume 2 (Java SE 8)</a> </li> 
      <li><a href='bugs9.html#CJ9V1'>9th Edition Volume 1 (Java SE 7)</a> </li> 
      <li><a href='bugs9.html#CJ9V2'>9th Edition Volume 2 (Java SE 7)</a> </li> 
      <li><a href='bugs8.html#CJ8V1'>8th Edition Volume 1 (Java SE 6)</a> </li> 
      <li><a href='bugs8.html#CJ8V2'>8th Edition Volume 2 (Java SE 6)</a> </li> 
      <li><a href='bugs7.html#CJ7V1'>7th Edition Volume 1 (Java SE 5.0)</a> </li> 
      <li><a href='bugs7.html#CJ7V2'>7th Edition Volume 2 (Java SE 5.0)</a> </li> 
      <li><a href='bugs5.html#CJ6V1'>6th Edition Volume 1 (Java SE 1.4)</a></li> 
      <li style='color: rgb(153, 153, 255);'>There was no 6th Edition Volume 2</li> 
      <li><a href='bugs5.html#CJ5V1'>5th Edition Volume 1 (Java SE 1.3) </a></li> 
      <li><a href='bugs5.html#CJ5V2'>5th Edition Volume 2 (Java SE 1.3/1.4) </a></li> 
      <li><a href='bugs4.html#CJ4V1'>4th Edition Volume 1 (Java SE 1.2) </a></li> 
      <li><a href='bugs4.html#CJ4V2'>4th Edition Volume 2 (Java SE 1.2) </a></li> 
      <li><a href='bugs2.html#ThirdEdition'>3rd Edition (JDK 1.1) </a></li> 
      <li><a href='bugs2.html#SecondEdition'>2nd Edition (JDK 1.02) </a></li> 
      <li><a href='bugs2.html#FirstEdition'>1st Edition (JDK 1.0) </a></li> 
    </ul> 
    <h3>How to Tell which Printing You Have</h3> 
    <p>On the bottom of the copyright page (facing the first page of the table of contents), look for a line such as “First printing, December 2015”. In the errata below, we indicate the <i>printing in which the error has been fixed</i> inside square brackets such as [4].</p> 
    <p>For example, suppose you have the fourth printing. Then you can <i>ignore</i> all reports that are prefixed with [2], [3] or [4]. But you would want to pay attention to all reports that are prefixed with [5] or higher or that have no bracketed prefix at all.</p> 
    <h2>10th Edition Volume 1 (Java SE 8)<a id='CJ10V1' name='CJ10V1'></a> <img class='sideimage' src='cj10v1.jpg' alt=''/></h2>
    <dl><dt>[2] Page 51</dt><dd>In the Caution note, change <code>\u00A0</code> to <code>\u000A</code>.</dd>
      <dt>[2] Page 74</dt>
      <dd>Change “The API documentation
is part of the JDK. It is in HTML format. Point your web browser to the
docs/api/index.html subdirectory of your JDK installation (Figure 3.2).” to “You can download the API documentation from Oracle and save it locally, or you can point your browser to <code>http://docs.oracle.com/javase/8/docs/api</code> (Figure 3.2).”</dd>
      <dt>[2] Page 89</dt>
      <dd>Change “Finally, there is a variant of the for loop that has no
analog in C or C++. It is similar to the foreach loop in C#.” to “Finally, there is a variant of the for loop that is similar to the range-based <code>for</code> loop in C++ and the <code>foreach</code> loop in C#.”</dd>
      <dt>[2] Page 150</dt>
      <dd>Change <pre>LocalDate hireDay = LocalDate.of(year, month, day);</pre> to <pre>hireDay = LocalDate.of(year, month, day);</pre></dd>
      <dt>[2] Page 173</dt>
      <dd>Change
        <pre>Employee(String name, double salary, int y, int m, int d)
</pre> to
        <pre>public Employee(String n, double s, int year, int month, int day)</pre></dd>
      <dt>[2] Page 178</dt>
      <dd>Move step 3 before Step 1 in the numbered list, and change “the body of the second constructor is executed” to “the object is constructed with the second constructor before continuing with the body of this constructor”</dd>
      <dt>[2] Page 183</dt>
      <dd>Change “For example, you can import all classes in the <code>java.util</code> package with the statement <code>import java.util.*;</code>” to “For example, you can import all classes in the <code>java.time</code> package with the statement <code>import java.time.*;</code>”</dd>
      <dt>[2] Page 189</dt>
      <dd>Change the section heading “Package Scope” to “Package Access”</dd>
      <dt>[2] Page 189</dt>
      <dd>Change “package visibility” to “package access”</dd>
      <dt>[2] Page 230</dt>
      <dd>Change <code>Object.equals(hireDay, other.hireDay)</code> to <code>Objects.equals(hireDay, other.hireDay)</code></dd>
      <dt>[2] Page 243</dt>
      <dd>Change
        <pre>return super.hashCode() + 17 * new Double(bonus).hashCode();</pre> to
        <pre>return java.util.Objects.hash(super.hashCode(), bonus);
</pre></dd>
      <dt>[2] Page 251</dt>
      <dd>Change <code>void set(int index, E obj)</code> to <code>E set(int index, E obj)</code> and “overwriting the previous contents” to “returning the previous contents.”</dd>
      <dt>[2] Page 258</dt>
      <dd>Remove the semicolon after <code>public enum Size { SMALL, MEDIUM, LARGE, EXTRA_LARGE }</code></dd>
      <dt>[2] Page 290</dt>
      <dd>Change “package visibility” to “package access”</dd>
      <dt>[2] Page 292</dt>
      <dd>Remove “for sorting an employee array”</dd>
      <dt>Page 296</dt>
      <dd>Change “Although you cannot put instance fields or static methods in an interface” to “Although you cannot put instance fields in an interface,”</dd>
      <dt>[2] Page 300</dt>
      <dd>Change “Consider another interface with a <code>getName</code> method:” to “Consider two interfaces with a <code>getName</code> method:” and change the code below to:
        <pre>interface Person
{
   default String getName() { return ""; };
}

interface Named
{
   default String getName() { return getClass().getName() + "_" + hashCode(); }
}
</pre></dd>
      <dt>Page 321</dt>
      <dd>Change the code on top of the page to the (even more contrived)
        <pre>class Greeter
{
   public void greet(ActionEvent event)
   {
      System.out.println("Hello, " + event);
   }
}

class TimedGreeter extends Greeter
{
   public void greet(ActionEvent event)
   {
      Timer t = new Timer(1000, super::greet);
      t.start();
   }
}</pre></dd>
      <dt>[2] Page 323</dt>
      <dd>Change “It is also illegal to refer to variable” to “It is also illegal to refer to a variable”.</dd>
      <dt>[2] Page 324</dt>
      <dd>Change <code>public class Application()</code> to <code>public class Application</code></dd>
      <dt>[2] Page 338</dt>
      <dd>Change “Since the secret access
methods have package visibility” to “Since the secret
methods have package access”</dd>
      <dt>[2] Page 341</dt>
      <dd>Remove the paragraph “As we already mentioned...always the same value” above the note.</dd>
      <dt>[2] Page 376</dt>
      <dd>Change
        <pre>try (Scanner in = new Scanner(new FileInputStream("/usr/share/dict/words"), "UTF-8")
</pre> to
        <pre>try (Scanner in = new Scanner(new FileInputStream("/usr/share/dict/words"), "UTF-8"))
</pre></dd>
      <dt>[2] Page 378</dt>
      <dd>Change
        <pre>StackTraceTest.factorial(StackTraceTest.java:18)
StackTraceTest.main(StackTraceTest.java:34)
factorial(2):
StackTraceTest.factorial(StackTraceTest.java:18)
StackTraceTest.factorial(StackTraceTest.java:24)
StackTraceTest.main(StackTraceTest.java:34)
factorial(1):
StackTraceTest.factorial(StackTraceTest.java:18)
StackTraceTest.factorial(StackTraceTest.java:24)
StackTraceTest.factorial(StackTraceTest.java:24)
StackTraceTest.main(StackTraceTest.java:34)</pre> to
        <pre>stackTrace.StackTraceTest.factorial(StackTraceTest.java:20)
stackTrace.StackTraceTest.main(StackTraceTest.java:36)
factorial(2):
stackTrace.StackTraceTest.factorial(StackTraceTest.java:20)
stackTrace.StackTraceTest.factorial(StackTraceTest.java:26)
stackTrace.StackTraceTest.main(StackTraceTest.java:36)
factorial(1):
stackTrace.StackTraceTest.factorial(StackTraceTest.java:20)
stackTrace.StackTraceTest.factorial(StackTraceTest.java:26)
stackTrace.StackTraceTest.factorial(StackTraceTest.java:26)
stackTrace.StackTraceTest.main(StackTraceTest.java:36)
</pre>
      </dd>
      <dt>[2] Page 393</dt>
      <dd>Change “At least up to Java SE 7” to “Up to Java SE 7”.</dd>
      <dt>[2] Page 428</dt>
      <dd>Change “Suppose the DateInterval method also
overrides the getSecond method:” to “Suppose the DateInterval class also
overrides the getSecond method:”</dd>
      <dt>[2] Page 428</dt>
      <dd>Change
        <pre>public void setSecond(Object second) { setSecond((Date) second); }</pre> to
        <pre>public void setSecond(Object second) { setSecond((LocalDate) second); }</pre>and change
        <pre>public LocalDate getSecond() { return (Date) super.getSecond().clone(); }</pre> to
        <pre>public LocalDate getSecond() { return (LocalDate) super.getSecond(); }</pre></dd>
      <dt>[2] Page 432</dt>
      <dd>Change
        <pre>for (t : ts) coll.add(t);</pre> to
        <pre>for (T t : ts) coll.add(t);</pre></dd>
      <dt>[2] Page 448</dt>
      <dd>Change
        <pre>PairAlg.swap(result); // OK--swapHelper captures wildcard type</pre> to
        <pre>PairAlg.swapHelper(result); // OK--swapHelper captures wildcard type</pre></dd>
        <dt>[2] Page 467</dt>
        <dd>Change <code>return = true;</code> to <code>return true;</code></dd>
      <dt>[2] Page 468</dt>
      <dd>Change <code>boolean add(Object element)</code> to <code>boolean add(E element)</code></dd>
      <dt>[2] Page 489</dt>
      <dd>Change <code>System.println</code> to <code>System.out.println</code></dd>
      <dt>[2] Page 492</dt>
        <dd>Change <code>descripion</code> to <code>description</code> in the <code>toString</code> method.</dd>
        <dt>[2] Page 493</dt>
        <dd>Change <code>E pollLast</code> to <code>E pollLast()</code></dd>
      <dt>[2] Page 496</dt>
      <dd>Change <code> @version 1.01 2012-01-26</code> to <code>@version 1.02 2015-06-20</code></dd>
      <dt>[2] Page 497</dt>
      <dd>Change <code>int score = scores.get(id, 0);</code> to <code>int score = scores.getOrDefault(id, 0);</code></dd>
      <dt>[2] Page 498</dt>
        <dd>Change <code>@version 1.11 2012-01-26</code> to <code>@version 1.12 2015-06-21</code></dd>
      <dt>[2] Page 501</dt>
      <dd>Change “ if the key was previously absent” to “ if the
        key was previously absent (or mapped to <code>null</code>).”, and add the following to the API note:
        <ul><li><code>default V putIfAbsent(K key, V value)</code> <span style='font-weight: bold; color: gray'>8</span><p>If <code>key</code> is absent or associated with <code>null</code>, associates it with <code>value</code> and returns <code>null</code>. Otherwise returns the associated value.</p>
          </li>
        </ul>
      </dd>
      <dt>[2] Page 510</dt>
      <dd>Change <code>List group2</code> to <code>List&lt;Employee&gt; group2</code></dd>
      <dt>[2] Page 513</dt>
      <dd>Change “The methods such as
<code>get</code> and <code>put</code> are serialized” to “The methods such as
          <code>get</code> and <code>put</code> are synchronized”</dd>
        <dt>Page 522</dt>
        <dd>Change “using a linear search if the element type implements the <code>RandomAccess</code> interface, and a binary search in all other cases” to “using a binary search if the element type implements the <code>RandomAccess</code> interface, and a linear search in all other cases”</dd>
      <dt>[2] Page 523</dt>
        <dd>Change <code>Collections.replaceAll("C++", "Java");</code> to <code>Collections.replaceAll(words, "C++", "Java");</code></dd>
        <dt>[2] Page 529</dt>
        <dd>Change
          <pre>Enumeration&lt;Employee&gt; e = staff.elements();
while (e.hasMoreElements())
{
   Employee e = e.nextElement();
   . . .
}</pre> to
          <pre>Enumeration&lt;Employee&gt; values = table.elements();
while (values.hasMoreElements())
{
   Employee e = values.nextElement();
. . .
}</pre></dd>
      <dt>[2] Page 550</dt>
      <dd>Add a bullet before “You can maximize
        a frame by calling”</dd>
      <dt>[2] Page 551</dt>
      <dd>Change <code>@version 1.33 2007-05-12</code> to <code>@version 1.34 2015-06-16</code></dd>
      <dt>[2] Page 566</dt>
      <dd>Change <code>@version 1.33 2007-05-12</code> to <code>@version 1.34 2015-06-16</code></dd>
      <dt>[2] Page 576</dt>
      <dd>Change
        <pre>Rectangle2D bounds = sansbold14..getStringBounds(message, context);</pre> to
        <pre>Rectangle2D bounds = sansbold14.getStringBounds(message, context);</pre></dd>
      <dt>[2] Page 670</dt>
      <dd>Change <pre>faceCombo.getItemAt(faceCombo.setSelectedIndex()),</pre> to
        <pre>faceCombo.getItemAt(faceCombo.getSelectedIndex()),
</pre></dd>
      <dt>[2] Page 680</dt>
      <dd>Change “When the user selects a menu” to “When the user selects a menu item”.</dd>
      <dt>[2] Page 686</dt>
      <dd>Change
        <pre>cutAction.putValue(Action.MNEMONIC_KEY, new Integer('A'));</pre> to
        <pre>aboutAction.putValue(Action.MNEMONIC_KEY, new Integer('A'));</pre></dd>
        <dt>[2] Page 707</dt>
        <dd>Change "The GBC helper class is in Listing 12.12" to "The GBC helper class is in Listing 12.11"</dd>
        <dt>[2] Page 889</dt>
        <dd>Change “must have must have” to “must have”</dd>
        <dt>[2] Page 933</dt>
        <dd>Change “wrapped in an unchecked <code>ExecutionException</code>” to “wrapped in an <code>ExecutionException</code>”</dd>
    </dl>
    
    <h2>10th Edition Volume 2 (Java SE 8) <a id='CJ10V2' name='CJ10V2'></a> <img class='sideimage' src='cj10v2.jpg' alt='???'/> </h2>
      <dl><dt>Page 238</dt>
        <dd>Change “If the timeout value has been set for a socket, all subsequent read and write operations” to “If the timeout value has been set for a socket, all subsequent read operations”</dd>
        <dt>Page 239</dt>
        <dd>Change <code>InterruptedIOException</code> to <code>SocketTimeoutException</code> (2x)</dd>
      </dl>
    <p>Thanks to Maxim Belyaev, Aaron Chen, Alexey Elin, Yasir Bajwa, Maxim Belyaev, Zuo Cheng, Gianni Fabriziani, Pavlo Gotsonoga, Dominik Gruntz, Detlef Herm, Justin Jia, Paul Orekhov, Liutauras Vilda, Henry Ying, Mehran Zare, Gaopeng Zhang, 陈栩林, and (your name might go here) for their bug reports!</p> 
    <h2>Bug Report Form</h2> 
    <p>If you have found another bug in the book or in our code that is not mentioned in this bug list or the <a href='faq.html'>Core Java FAQ</a> , then please send a report. Unfortunately, I cannot reply personally to each report, but I do read all your comments.</p> 
    <form onsubmit='return checksubmit(document.forms["feedback"])' method='post' id='feedback' action='/cgi-bin/feedback.pl'>
      <p><input value='Core Java Bug Report' type='hidden' name='subject'/> <input value='11' type='hidden' name='recipient'/></p> 
      <p>Your name: <br/> <input type='text' size='48' name='Name'/><br/> Your email address: <br/> <input type='text' size='48' name='email'/><br/> Edition: <select size='1' name='Edition'>
          <option value='1'>1st Edition (JDK 1.0)</option> 
          <option value='2'>2nd Edition (JDK 1.02)</option> 
          <option value='3v1'>3rd Edition (JDK 1.1) Volume 1</option> 
          <option value='3v2'>3rd Edition (JDK 1.1) Volume 2</option> 
          <option value='4v1'>4th Edition (Java SE 1.2) Volume 1</option> 
          <option value='4v2'>4th Edition (Java SE 1.2) Volume 2</option> 
          <option value='5v1'>5th Edition (Java SE 1.3) Volume 1</option> 
          <option value='5v2'>5th Edition (Java SE 1.3/1.4) Volume 2</option> 
          <option value='6v1'>6th Edition (Java SE 1.4) Volume 1</option> 
          <option value='7v1'>7th Edition (Java SE 5.0) Volume 1</option> 
          <option value='7v2'>7th Edition (Java SE 5.0) Volume 2</option> 
          <option value='8v1'>8th Edition (Java SE 6) Volume 1</option> 
          <option value='8v2'>8th Edition (Java SE 6) Volume 2</option> 
          <option value='9v1'>9th Edition (Java SE 7) Volume 1</option> 
          <option value='9v2'>9th Edition (Java SE 7) Volume 2</option> 
          <option value='10v1' selected='selected'>10th Edition (Java SE 8) Volume 1</option> 
          <option value='10v2'>10th Edition (Java SE 8) Volume 2</option> 
        </select> <br/> Page number: <input type='text' size='4' name='Page'/></p> 
      <p>Problem description: <br/> <textarea rows='8' name='Problem' cols='60'></textarea> </p> 
      <p>To protect against spam robots, please answer this simple math problem:<br/> <input type='text' size='2' readonly='readonly' name='arg1'/> * <input type='text' size='2' readonly='readonly' name='arg2'/> = <input type='text' name='res'/> <input value='Submit Report' type='submit'/></p> 
    </form> 
    <hr/> 
    <p>Back to the <a href='http://www.horstmann.com/corejava.html'>Core Java</a> page.</p> 
  </body> 
</html>
